@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* 导入自定义样式 */
@import './styles/colors.css';
@import './styles/animations.css';
@import './styles/responsive.css';

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  * {
    @apply transition-all duration-200;
  }
  
  body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    color: #0f172a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* 自定义滚动条 */
  ::-webkit-scrollbar {
    width: 6px;
  }

  ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }

  ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
  }
}

@layer components {
  /* 基础卡片样式 */
  .card {
    @apply bg-white rounded-2xl shadow-sm border border-slate-200/60 p-6;
  }

  /* 滑动任务卡片样式 */
  .swipeable-task-item {
    @apply relative overflow-hidden;
    touch-action: pan-y;
  }

  .swipeable-task-item .task-content {
    @apply relative z-10 transition-transform duration-300 ease-out;
  }

  .swipeable-task-item .task-content.swiping {
    transition: none;
  }

  .swipeable-task-item .swipe-actions {
    @apply absolute top-0 right-0 h-full flex items-center justify-center;
    @apply bg-gradient-to-l from-red-500 to-red-600 text-white;
  }

  .swipeable-task-item .delete-action {
    @apply flex flex-col items-center gap-1 px-4 py-2;
    @apply text-white font-medium transition-all duration-200;
  }

  .swipeable-task-item .delete-action:hover {
    @apply bg-red-700;
  }

  .swipeable-task-item .delete-confirm {
    @apply animate-pulse;
  }

  .card:hover {
    @apply shadow-md border-slate-300/60;
  }

  /* 按钮样式 */
  .btn-primary {
    @apply bg-blue-600 hover:bg-blue-700 text-white px-4 py-2.5 rounded-xl font-medium shadow-sm hover:shadow-md;
  }

  .btn-secondary {
    @apply bg-slate-100 hover:bg-slate-200 text-slate-700 px-4 py-2.5 rounded-xl font-medium;
  }

  .btn-ghost {
    @apply text-slate-600 hover:text-slate-900 hover:bg-slate-100 px-3 py-2 rounded-lg font-medium;
  }

  /* 输入框样式 */
  .input-field {
    @apply w-full px-4 py-3 bg-white border border-slate-200 rounded-xl text-slate-900 placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500;
  }

  /* 任务卡片 - 优化后的紧凑设计 */
  .task-card {
    @apply bg-white rounded-xl border border-slate-200/60 cursor-pointer;
    padding: 12px 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .task-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(148, 163, 184, 0.4);
  }

  /* 移动端优化 */
  @media (max-width: 640px) {
    .task-card {
      padding: 10px 12px;
      border-radius: 12px;
    }
  }

  /* 文本截断样式 */
  .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* 触摸优化 */
  .touch-manipulation {
    touch-action: manipulation;
  }

  /* AI建议卡片 - 已移至组件内部样式 */

  /* 导航样式 */
  .nav-card {
    @apply bg-white/95 backdrop-blur-sm border border-slate-200/60 shadow-sm;
  }

  /* 优先级颜色 */
  .priority-p0 {
    @apply border-l-4 border-red-400;
  }
  
  .priority-p1 {
    @apply border-l-4 border-orange-400;
  }
  
  .priority-p2 {
    @apply border-l-4 border-yellow-400;
  }
  
  .priority-p3 {
    @apply border-l-4 border-green-400;
  }

  /* 标签样式 */
  .tag {
    @apply px-2.5 py-1 text-xs font-medium rounded-full;
  }

  .tag-red {
    @apply bg-red-100 text-red-700;
  }

  .tag-orange {
    @apply bg-orange-100 text-orange-700;
  }

  .tag-yellow {
    @apply bg-yellow-100 text-yellow-700;
  }

  .tag-green {
    @apply bg-green-100 text-green-700;
  }

  .tag-blue {
    @apply bg-blue-100 text-blue-700;
  }

  .tag-gray {
    @apply bg-slate-100 text-slate-700;
  }

  /* 动画 */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-fade-in-up {
    animation: fadeInUp 0.4s ease-out;
  }

  .animate-fade-in-scale {
    animation: fadeInScale 0.3s ease-out;
  }

  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.95);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* 工具类 */
  .text-muted {
    @apply text-slate-500;
  }

  .text-primary {
    @apply text-slate-900;
  }

  .bg-surface {
    @apply bg-slate-50;
  }

  .divider {
    @apply border-t border-slate-200;
  }
}